package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DoctorInfoMapper;
import com.ruoyi.system.domain.DoctorInfo;
import com.ruoyi.system.service.IDoctorInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 专家信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-11-09
 */
@Service("doctor")
public class DoctorInfoServiceImpl implements IDoctorInfoService 
{
    @Autowired
    private DoctorInfoMapper doctorInfoMapper;

    /**
     * 查询专家信息
     * 
     * @param id 专家信息主键
     * @return 专家信息
     */
    @Override
    public DoctorInfo selectDoctorInfoById(Long id)
    {
        return doctorInfoMapper.selectDoctorInfoById(id);
    }

    @Override
    public DoctorInfo selectUserNameByUsername(String Username) {
        return doctorInfoMapper.selectUserNameByUsername(Username);
    }

    /**
     * 查询专家信息列表
     * 
     * @param doctorInfo 专家信息
     * @return 专家信息
     */
    @Override
    public List<DoctorInfo> selectDoctorInfoList(DoctorInfo doctorInfo)
    {
        return doctorInfoMapper.selectDoctorInfoList(doctorInfo);
    }

    /**
     * 专家信息下拉框
     * @return 专家信息
     */
    @Override
    public List<DoctorInfo> selectDoctorInfoList() {
        DoctorInfo doctorInfo = null;
        return selectDoctorInfoList(doctorInfo);
    }

    /**
     * 新增专家信息
     * 
     * @param doctorInfo 专家信息
     * @return 结果
     */
    @Override
    public int insertDoctorInfo(DoctorInfo doctorInfo)
    {
        return doctorInfoMapper.insertDoctorInfo(doctorInfo);
    }

    /**
     * 修改专家信息
     * 
     * @param doctorInfo 专家信息
     * @return 结果
     */
    @Override
    public int updateDoctorInfo(DoctorInfo doctorInfo)
    {
        return doctorInfoMapper.updateDoctorInfo(doctorInfo);
    }

    /**
     * 批量删除专家信息
     * 
     * @param ids 需要删除的专家信息主键
     * @return 结果
     */
    @Override
    public int deleteDoctorInfoByIds(String ids)
    {
        return doctorInfoMapper.deleteDoctorInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除专家信息信息
     * 
     * @param id 专家信息主键
     * @return 结果
     */
    @Override
    public int deleteDoctorInfoById(Long id)
    {
        return doctorInfoMapper.deleteDoctorInfoById(id);
    }

    @Override
    public Long selectIdByName(String Name) {
        return doctorInfoMapper.selectIdByName(Name);
    }
}
